<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        (function(){
            function f1() {
                let num = 123;
                function f2() {
                    let num =777
                    console.log(num)   //输出结果123
                }
                f2()
             }
            let num = 456
            f1()
        })();
        console.clear();
        

        (function(){
            let a = 1;
            let b = '44'
            function fn1() {
                let a = 2
               
                fn2()
                function fn2() {
                    let a = 3
                    fn3()
                    function fn3() {
                        let a = 4
                        console.log(a) //a的值 ?   4
                        console.log(b) //b的值 ?   22
                    }
                }
            }
            fn1()
        })();
        
        
    </script>
</body>
</html>